﻿namespace TfsCloudDeploy.Workflow.Tests.Utility
{
    using System.Collections.Generic;
    using TfsActivities = Microsoft.TeamFoundation.Build.Workflow.Activities;
    using System;
    using Microsoft.TeamFoundation.Build.Workflow;

    public static class WorkflowTestHelpers
    {
        public static IDictionary<string, object> GetProcessParameters()
        {
            IDictionary<string, object> processParameters = new Dictionary<string, object>();

            //Set BuildSettings properties 
            TfsActivities.BuildSettings settings = new TfsActivities.BuildSettings();
            settings.ProjectsToBuild = new TfsActivities.StringList("$/TestProject/testproject.sln");
            settings.PlatformConfigurations = new TfsActivities.PlatformConfigurationList();
            settings.PlatformConfigurations.Add(new TfsActivities.PlatformConfiguration("Any CPU", "Release"));
            processParameters.Add("BuildSettings", settings);
            processParameters.Add("DropBuild", false);
            processParameters.Add("TestSpecs", new TfsActivities.TestSpecList());
            processParameters.Add("BuildNumberFormat", string.Empty);
            processParameters.Add("CleanWorkspace", TfsActivities.CleanWorkspaceOption.None);
            processParameters.Add("RunCodeAnalysis", TfsActivities.CodeAnalysisOption.Never);
            processParameters.Add("SourceAndSymbolServerSettings", new TfsActivities.SourceAndSymbolServerSettings(false, string.Empty));
            processParameters.Add("AgentSettings", new TfsActivities.AgentSettings(TimeSpan.Zero, TimeSpan.Zero));
            processParameters.Add("AssociateChangesetsAndWorkItems", false);
            processParameters.Add("CreateWorkItem", false);
            processParameters.Add("MSBuildArguments", string.Empty);
            processParameters.Add("MSBuildPlatform", TfsActivities.ToolPlatform.Auto);
            processParameters.Add("PerformTestImpactAnalysis", false);
            processParameters.Add("CreateLabel", false);
            processParameters.Add("DisableTests", true);
            processParameters.Add("GetVersion", string.Empty);
            processParameters.Add("PrivateDropLocation", string.Empty);
            processParameters.Add("Verbosity", BuildVerbosity.Normal);

            return processParameters;
        }
    }
}
